package com.gwz.service.admin;

import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gwz.mapper.AdminMapper;
import com.gwz.model.Admin;

/**
 * 登录service
 * @author panguixiang
 *
 */
@Service
public class AdminService {

    @Autowired
    private AdminMapper adminMapper;

    /**
     * 登录验证
     * @param account
     * @param password
     * @return
     */
    public Admin login(String account, String password) {
        password = DigestUtils.md5Hex(password);//md5签名
        return adminMapper.adminLogin(account, password);
    }
    
    public static void main(String args[]) {
    	System.out.println(DigestUtils.md5Hex("123456"));
    }

}
